package com.ybxx.hr.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;
import com.ybxx.hr.dao.WorkContentDao;
import com.ybxx.hr.model.School;
import com.ybxx.hr.model.WorkContent;
import com.ybxx.hr.service.WorkContentService;

public class WorkContentServiceImpl extends BaseServiceImpl<WorkContent>
		implements WorkContentService {
	private WorkContentDao workContentDao;
	public WorkContentServiceImpl(WorkContentDao dao) {
		super(dao);
		this.workContentDao=dao;
		// TODO Auto-generated constructor stub
	}
	public List<WorkContent> queryPage(WorkContent workContent,QueryFilter filter) {
		String hql="from WorkContent wc";
		String condition=" where ";
		if(workContent!=null && StringUtils.isNotEmpty(workContent.getWcname())){
			hql+=condition+" wc.wcname='"+workContent.getWcname()+"' ";
		}
		return workContentDao.findByHql(hql, null,filter.getPagingBean());
	}
}
